<@admin.header title="修改系统消息推送">
<@common.validate/>
<@common.timeselector/>
<script type="text/javascript">
    $(document).ready(function(){
		$('#mainForm').validate();
		changeRange();
    });
	var form = new App.common.form();
	var ajax = new App.common.ajax();
	
	function toSelect(){
		ajax.open("auth/user/select.do?function=onSelect","选择接收对象",1000,500);
	}
	
	function onSelect(ids,names){
		$('#idsLink').val(";"+ids);
		$("#sel_names").val(";"+names);
	}
	
	function changeRange(){
		var v = form.radio("sendType");
		if(v=='immediate'){
			$("#select_li").hide(100);
			$("#sel_planTime").val("");
		}else{
			$("#select_li").show(100);
		}
	}
</script>

</@admin.header>
<body>
    <div class="place">
        <span>位置：</span>
        <ul class="placeul">
            <li>
                <a href="${base}/right.do">首页</a>
            </li>
            <li>
                <a href="list.do">系统消息推送管理</a>
            </li>
            <li>
                <a href="#">修改系统消息推送</a>
            </li>
        </ul>
    </div>
	
	<form action="edit.do" method="post" id="mainForm">
		<input type="hidden" name="id" value="${entity.id}" />
	    <div class="formbody">
	        <div class="formtitle">
	            <span>基本信息</span>
	        </div>
			<ul class="forminfo">
	        	<li>
	                <label class="field">发送方式</label>
					<@common.orNot options={"immediate":"立即发送","plan":"定时发送"} fieldName="sendType" fieldValue="${entity.sendType!'immediate'}" otherAttr="onclick='changeRange();'"/>
	            </li>
				<li id="select_li" class="hide" style="display:none;">
	                <label class="field">定时发送时间</label>
					<input type="text" name="planTime"  class="dfinput" id="sel_planTime" name="planTime" value="${entity.planTime!''}" onClick="javascript:WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" />
					<i>请选择发送时间</i>
	            </li>
	            <li>
	                <label class="field">推送标题</label>
	                <input name="title" type="text" class="dfinput" validate="{required:true,maxlength:25}" value="${entity.title!''}"style="width:347px;"/><i>请填写需要推送的标题</i>
	            </li>
				<li>
	                <label class="field">接收对象</label>
	                <textarea id="sel_names" name="receiveNames" cols="" rows="" class="textinput" onclick="toSelect();" style="width:347px;" validate="{required:true}">${entity.receiveNames!''}</textarea>
					<input type="hidden" name="receiveIds" value="" id="idsLink" value="${entity.receiveIdsreceiveIds!''}"/>
					<i>请点击左方框选取接收人</i>
	            </li>
				<li>
	                <label class="field">推送内容</label>
					<textarea name="content" cols="" rows="" class="textinput" style="width:347px;" validate="{required:true,maxlength:250}">${entity.content!''}</textarea>
					<i>请填写需要推送的内容</i>
	            </li>
	            <li>
	                <label class="field">
	                    &nbsp;
	                </label>
	                <input type="submit" class="btn" value="确认保存"/>
	            </li>
	        </ul>
	    </div>
	</form>
</body>
</html>